package com.practice.springboot_01_zwj.service;

import com.github.pagehelper.PageInfo;
import com.practice.springboot_01_zwj.controller.CloudNetworkController;
import com.practice.springboot_01_zwj.entity.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public interface CloudNetworkService {

    PageInfo<CloudNetwork> selectByCityCode(String cityCode, String providerType , int pageNum, int pageSize);
//政务外网客户清单增删改查
    int addNetworkCustomer(CloudNetwork cloudNetwork);
    int updateNetworkCustomer(CloudNetwork cloudNetwork);
    int deleteNetworkCustomer(Integer id);
    PageInfo<CloudNetwork> selectByCityCodeAndCustomerType(String cityCode, String customerType , String  districtName,String customerName, int pageNum, int pageSize);
    /**
     * 获取地市统计信息
     * @return 地市统计信息列表
     */
    List<CloudNetworkController.CityStatsDTO> getCityStats();
    //区县下拉列表
    List<CloudNetwork> selectDistrictName(String cityCode);

//政务外网商机清单增删改查
    int addNetworkShangJi(CloudNetwork cloudNetwork);
    int updateNetworkShangJi(CloudNetwork cloudNetwork);
    int deleteNetworkShangJi(Integer id);
    PageInfo<CloudNetwork> selectByCityCodeAndProviderType(
            String cityCode,
            String providerType,
            String districtName,
            int pageNum,
            int pageSize);
    /**
     * 分页查询（带合同结束时间筛选）
     * @return 分页结果
     */
    PageInfo<CloudNetwork> selectByCityCodeAndProviderType(
            String cityCode,
            String providerType,
            String districtName,
            Boolean filterByContractEndTime,
            int pageNum,
            int pageSize);

    List<Map<String, Object>> countShangJiByCityCode();

    List<Map<String, Object>> countByFourLevelClassify(Boolean filterByContractEndTime,String providerType);

//政务云客户清单增删改查
    int addCloudCustomerType(CloudNetwork cloudNetwork);
    int updateCloudCustomerType(CloudNetwork cloudNetwork);
    int deleteCloudCustomerType(Integer id);
    PageInfo<CloudNetwork> selectCloudCustomerType(String cityCode,String customerType,String providerType, int pageNum, int pageSize);
    List<Map<String, Object>> countByCustomerType();

//政务云商机清单的增删改查
    int addCloudComplete(CloudNetwork cloudNetwork);
    int updateCloudComplete(CloudNetwork cloudNetwork);
    int deleteCloudComplete(Integer id);
    PageInfo<CloudNetwork> selectCloudComplete(
            String cityCode,
            String providerType,
            int pageNum,
            int pageSize);
    PageInfo<CloudNetwork> selectCloudComplete(String cityCode,String providerType,Boolean filterByContractEndTime, int pageNum, int pageSize);
    List<Map<String, Object>> countCloudCompleteByCityCode();
    List<Map<String, Object>> countCloudCompleteByContractEndTime(String cityCode,String providerType, Boolean filterByContractEndTime);
}
